package org.example.springcloud.service;

import org.example.springcloud.entities.Payment;
import org.example.springcloud.result.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 *
 * @author Jandmla
 * Date: 2022/8/3
 * Time: 10:24
 * Description:
 */
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {

    /**
     * OpenFeign调用接口
     * @param id id
     * @return 查询结果
     */
    @GetMapping(value = "/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    /**
     * OpenFeign超时测试
     * @return 端口号
     */
    @GetMapping(value = "/payment/geign/timeout")
    public String paymentFeignTimeout();
}